﻿using ReflectionStudio.Core.Events;
using System;
using System.Data;
using System.Windows;
using System.Windows.Data;
using System.ComponentModel;
namespace WPFExcelReport
{
    public partial class TSWFD
    {
        public TSWFD()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            MV = new VWAFARBEN();
            DataContext = MV;
            InitializeComponent();
        }
        public override void vwMaster_CurrentChanged(object sender, EventArgs e)
        {
            base.vwMaster_CurrentChanged(sender, e);
            if (dwMaster == null)
            {
                DESS = "";
                COLORIT = "";
            }
            else
            {
                DESS = TMV.WAFZUSATZ;
                COLORIT = TMV.WAFCOLORIT;
            }
        }
        public override void OnEXAUFChg(string vlaue)
        {
            if (!IsCanLoad)
                return;
            TBMain.Clear();
            if (vlaue.Trim().Length == 0)
                return;
            dwData = TBMain.NewRow();
            dwData["WAFMANDANT"] = app.Mandant;
            dwData["WAFART"] = vlaue.Substring(1, 20);
            dwData["WAFVAR"] = vlaue.Substring(21, 2);
            dwData["WAFZUART"] = "D";
            SResult = TMV.QWAF_1(dwData);
            MergeData(SResult, false); 
            base.OnEXAUFChg(vlaue);
        }
        public override void LOADALL()
        {
            string vlaue = EXAUF;
            EXAUF = "";
            EXAUF = vlaue;
            base.LOADALL();
        }
        public override void ComboBox_DropDownOpened(object sender, EventArgs e)
        {
          
            base.ComboBox_DropDownOpened(sender, e);
        }
    }
}
